// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1

Row{
    id: _root
    spacing: 1

    property real clockNumberWidth: 16
    property real clockColonWidth: 6

    property variant numberPics: []
    property string colonPic: ""

    Component.onCompleted: {
        updateClock();
    }

    Timer{
        interval: 10000
        repeat: true
        running: true
        onTriggered: {
            updateClock();
        }
    }

    function updateClock(){
        var d = new Date();
        var h1 = Math.floor(d.getHours() / 10);
        var h2 = d.getHours() % 10;
        var m1 = Math.floor(d.getMinutes() / 10);
        var m2 = d.getMinutes() % 10;

        _h1.source = numberPics[h1];
        _h2.source = numberPics[h2];
        _m1.source = numberPics[m1];
        _m2.source = numberPics[m2];
    }

    Image{
        id: _h1
        width:clockNumberWidth
        height: _root.height
        source: ""
        smooth:true
    }
    Image{
        id: _h2
        width:clockNumberWidth
        height: _root.height
        source: ""
        smooth:true
    }
    Image{
        width: clockColonWidth
        height: _root.height
        source: colonPic// "images/bar_num_c.png"
        smooth:true
    }
    Image{
        id: _m1
        width:clockNumberWidth
        height: _root.height
        source: ""
        smooth:true
    }
    Image{
        id: _m2
        width:clockNumberWidth
        height: _root.height
        source: ""
        smooth:true
    }
}
